function des_core
  --moods inline
  (plaintext : vec64;
  key : vec56;
  encrypt : std_logic)
return vec64
is
    variable data : vec64;
variable working_key : vec56 := key;
begin
  data := initial_permutation(plaintext);
  for round in 0 to 15 loop
    working_key :=           
    key_rotate(working_key,round,encrypt);
    data := data(33 to 64) &
    (f(data(33 to 64),key_compress(working_key))
    xor
    data(1 to 32));
  end loop;
  return
    final_permutation(data(33 to 64) & data(1 to 32));
end;